from . import db
import datetime
class Tickets(db.Model):
    __tablename__ = "ticket"
    id=db.Column(db.Integer, primary_key=True,autoincrement=True)
    time_start=db.Column(db.DateTime, default=datetime.datetime.now)
    time_arrived=db.Column(db.DateTime, default=datetime.datetime.now)
    start=db.Column(db.String(50), nullable=False)
    arrived = db.Column(db.String(50), nullable=False)
    num = db.Column(db.String(50), nullable=False)
    seats=db.Column(db.Integer)
    price=db.Column(db.Float)
    ext=db.Column(db.String(50), default='',nullable=False)

class Person(db.Model):

    __tablename__ = "person"
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    name=db.Column(db.String(50), nullable=False)
    phone_number=db.Column(db.String(50), nullable=False)
    password=db.Column(db.String(50), nullable=False)
    user_type=db.Column(db.Integer)


class Order(db.Model):
    __tablename__ = "course"
    id=db.Column(db.Integer, primary_key=True,autoincrement=True)
    user_id=db.Column(db.Integer)
    ticket_id=db.Column(db.Integer)
    num=db.Column(db.String(50), nullable=False)
    time_start=db.Column(db.DateTime, default=datetime.datetime.now)
    arrived=db.Column(db.String(50), nullable=False)
    name=db.Column(db.String(50), nullable=False)
    phone=db.Column(db.String(50), nullable=False)
    id_card=db.Column(db.String(50), nullable=False)
    is_safe=db.Column(db.Integer)





